home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / cprog / deform.lha / Deform.txt
Encoding:
Text File  |  1993-03-06  |  1.7 KB  |  51 lines

  1.  
  2. In article <1l6lkkINN1kl@emory.mathcs.emory.edu>, sb@next.neuro.emory.edu (Stephen O. Berger) writes:
  3. >   Hi,
  4. >     I'm looking for information on realtime deformation algorithims.
  5. >   What I'd like to do is have some 3-D object like a sphere composed
  6. >   of polygonal faces and be able to interactively prod the sphere
  7. >   and see it deform proportionally to the applied force.
  8. >     Has anyone out there done anything similiar to this, or know of
  9. >   any good articles that might address this problem ?  I'd even be
  10. >   intested in 2-D versions of this problem (i.e. deformation of a
  11. >   series of connected line segments).  Please respond by internet
  12. >   mail if possible and I'll summarize the responses if there is enough
  13. >   interest.
  14. >   Steve Berger (sb@onripx.neuro.emory.edu)
  15.  
  16.  
  17. I know a simple algorythm, i already use to perform 3D objects transformations :
  18.  
  19. Use two array ( or equivalent) : 
  20.     - the first one contains the source point ( in 2D or in 3D ) - named S -
  21.     - the second one contains the destination coordinates - named D -
  22.  
  23. Then use one ( or two or tree coef ) - named co1 co2 co3 ( from 0 to .. 1 ) -
  24.     and display all points like that :
  25.  
  26.         x = S.x[ii] * co1  +  ( D.x[ii] * ( 1 - co1 );
  27.         y = S.y[ii] * co2  +  ( D.y[ii] * ( 1 - co2 );
  28.         z = S.z ..... co3 ....... z ........... co3
  29.  
  30.     And then increment co1, co2, co3 ( step .001 ) for example.
  31.  
  32. It's not very efficient but it's a great idea to start ... No ?
  33.  
  34.  
  35.                 Bye ... all your comments will be welcome
  36.  
  37. -- 
  38. ____________________________________________________________________________
  39.  
  40. JOLY Thomas
  41. University of PARIS VII ( Jussieu )
  42. Licence Informatique
  43. mail : joly@amertume.ufr-info-p7.ibp.fr
  44. ____________________________________________________________________________
  45.